import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XyywShopProductCommentForm, XyywShopProductCommentQuery, XyywShopProductCommentVo } from '@/api/xyyw/model/shopProductCommentModel';
import { request } from '@/utils/request';

// 查询商铺商品评论列表
export function listShopProductComment(query?: XyywShopProductCommentQuery) {
  return request.get<TableDataInfo<XyywShopProductCommentVo>>({
    url: '/xyyw/shopProductComment/list',
    params: query,
  });
}

// 查询商铺商品评论详细
export function getShopProductComment(commentId: number) {
  return request.get<R<XyywShopProductCommentVo>>({
    url: `/xyyw/shopProductComment/${commentId}`,
  });
}

// 新增商铺商品评论
export function addShopProductComment(data: XyywShopProductCommentForm) {
  return request.post<R<void>>({
    url: '/xyyw/shopProductComment',
    data,
  });
}

// 修改商铺商品评论
export function updateShopProductComment(data: XyywShopProductCommentForm) {
  return request.put<R<void>>({
    url: '/xyyw/shopProductComment',
    data,
  });
}

// 删除商铺商品评论
export function delShopProductComment(commentIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xyyw/shopProductComment/${commentIds}`,
  });
}
